mini.parse();
var grid = mini.get("grid1");
var pager = grid.getBottomPager();	//分页控件
(function(){
    request('0',pager.getPageSize());
})();
//请求接口
function request(pageIndex,pageSize){
    var pageIndex = pager.getPageIndex()
    var pageSize = pager.getPageSize();
    $.ajax({
        url: ajaxUrl+"/meetingData/findAllToSummary.do",
        type: "post",
        data:{
            pageIndex:pageIndex,
            pageSize:pageSize
        },
        success: function(data) {//请求成功完成后要执行的方法
            console.log(data);
            data = JSON.parse(data)
            console.log(typeof data);
            grid.setData(data.data);
            pager.set({"totalCount": data.total})
        },
        error:function(data){
            mini.alert("cuole");
        }
    });
}

//分页
grid.on("beforeload", function (e) {
    //阻止本来的翻页功能
    e.cancel = true;
    //当前页码
    var cunrrentPageIndex = grid.getPageIndex();
    //点击按钮之后的页码
    var pageIndex = e.data.pageIndex;
    //设置当前页数值
    pager.set({"pageIndex": pageIndex});
    //数据总数
    //var pageCount = pubPageCount;
    pager.set({"pageIndex": pageIndex});
    request(pageIndex + 1, pager.getPageSize());
});


//跳转增加页面
function addRow(){
    mini.open({

        targetWindow: window,
        url:"Conferenceroomson.html",
        title:"新增会议室",
        height:600,
        width:980,
        showMaxButton: true,
        showModal:Boolean,
        allowResize:Boolean,
        setReadOnly:false,
        onload: function () {

        },
        ondestroy: function (action) {
            if(action=="ok"){


            }
        }
    })
}
//跳转编辑页面
function editRow(){
    mini.open({

        targetWindow: window,
        url:"Conferenceroomson2.html",
        title:"新增会议室",
        height:600,
        width:980,
        showMaxButton: true,
        showModal:Boolean,
        allowResize:Boolean,
        setReadOnly:false,
        onload: function () {

        },
        ondestroy: function (action) {
            if(action=="ok"){


            }
        }
    })
}
//查询
function find(){
    var aaa=form.getData();

    console.log(aaa);
    aaa=JSON.stringify(aaa);
    console.log(aaa);
    $.ajax({
        url: baseUrl+"/carInfo/queryWhereCoulmn.do",
        type: "post",
        contentType: "application/json",
        data:aaa,
        success: function(data) {//请求成功完成后要执行的方法
            console.log(data);
            grid.setData('');
            grid.setData(data.obj);
            mini.after(data.msg)
        },
        error:function(data){
            mini.alert(cuole);
        }
    });
}
function removeRow(){
    var rows = grid.getSelecteds();
    if (rows.length>0){
        var obj = []
        for(var i = 0; i < rows.length; i++){
            var o = rows[i]
            obj.push(o.id);
        }
        $.ajax({
            url:ajaxUrl+"/meetingData/deleteData.do?ids="+obj,
            type:"post",
            success:function (data) {
                data = JSON.parse(data);
                mini.alert(data.msg)
                request();
            }
        })
    }else{
        mini.alert("请选中一行记录")
    }}
//刷新
function onRefresh(e) {
    list(pager.getPageIndex(), pager.getPageSize());
}


//条件查询清空条件
function clean() {
    form.reset();
}
//刷新按钮
function refresh(){
    request('0',pager.getPageSize());
}